package com.itheima.api.calendar;

import java.util.Calendar;

public class CalenderDemo2 {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        /*
            set(int field, int value)   将给定的日历字段设置为给定值
            void set(int year, int month, int date) 设置日历字段 YEAR,MONTH 和DAY_OF_MONTH 的值

            void add(int field , int amount) 根据日历的规则,为给定的字段添加或减去指定的时间量

        * */
        cal.set(Calendar.YEAR,2012);
        CalenderDemo.getDate(cal);
        cal.set(2011,10,11);
        CalenderDemo.getDate(cal);

        cal.add(Calendar.DAY_OF_MONTH,-1);
        CalenderDemo.getDate(cal);

    }
}
